package com.learn.hibernatevalidator.chapter05.groupsequences;

import jakarta.validation.constraints.AssertTrue;
import jakarta.validation.constraints.Min;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * @author: liyf
 * @create: 2025-01-05 21:05
 **/
@EqualsAndHashCode(callSuper = true)
@Data
public class Driver extends Person {

    @AssertTrue(
            message = "You first have to pass the driving test",
            groups = DriverChecks.class
    )
    public boolean hasDrivingLicense;
    @Min(
            value = 18,
            message = "You have to be 18 to drive a car.",
            groups = com.learn.hibernatevalidator.chapter05.defaultgroups.DriverChecks.class
    )
    private int age;
}
